var app = getApp()
Page({
  data: {
    headImg:'',
    nickName:'',

  },
  onLoad: function (e) {
    

  },

  onReady: function () {
    var that = this
    wx.getUserInfo({
      success:function(res){
        console.log(res)
        that.setData({
          headImg: res.userInfo.avatarUrl,
          nickName: res.userInfo.nickName
        })
      }
    })
    
  },
  onLaunch: function (options) {

  },
  onShow: function () {
    
  },
  navigateTo: function (e) {
    var to = e.currentTarget.dataset.item;
    var that = this
    switch (to) {
      case 'market'://名片模板市场
        wx.navigateTo({
          url: '/pages/template/market/market-list',
        })
        break;
      case 'template'://我的模板
        wx.navigateTo({
          url: '/pages/my/my-template/my-template',
        })
        break;
    }
    
    
  },
  
}) 
